
//加载原始js的常用函数库lodash
window._ = require('lodash');

//映入jq和组件库element-ui
try{
    window.$ = window.jQuery = require('jquery');
    require('element-ui');
}catch(e){

}

window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-with'] = 'XMLHttpRequest';

let token = document.head.querySelector('meta[name="csrf-token"]');

if (token) {
    window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else {
    console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}

import Vue from  'vue';
import router from './routes';
import store from './store';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI);

(new Vue({
    router,
    store
})).$mount('#app');
